home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cracking 2
/
Cracking II..iso
/
Priklady
/
Priklad 6
/
DETECT6.ASM
next >
Wrap
Assembly Source File
|
2000-08-16
|
2KB
|
71 lines
.386
.MODEL FLAT,STDCALL
locals
jumps
UNICODE=0
include w32.inc
Extrn SetUnhandledExceptionFilter : PROC
.data
sprava1 db "Detekcia2 pomocou CreateFileA",0
sprava3 db "Soft-Ice najdeny",0
sprava2 db "Soft-Ice nenasiel",0
odlozESP dd 0 ;sem uklada register ESP
predchadzajuca dd 0 ;sem uklada adresu predchadzajucej obsluhy SEH
SOFTVIDEO db "\\.\SIWVID",0 ;meno grafickeho ovladaca Soft-Ice
.code
Start:
;----------------------------------------------------------------------------
;NASTAVI SEH PRE PRIPAD CHYBY
;----------------------------------------------------------------------------
mov [odlozESP],esp
push offset chyba
call SetUnhandledExceptionFilter
mov [predchadzajuca], eax
;----------------------------------------------------------------------------
call CreateFileA, OFFSET SOFTVIDEO, FILE_FLAG_WRITE_THROUGH, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL
;snazi sa otvorit subor \\.\SIWVID
push eax ;ulozi navratovu hodnotu
;----------------------------------------------------------------------------
;NASTAVI PREDCHADZAJUCU OBSLUHU SEH
;----------------------------------------------------------------------------
push dword ptr [predchadzajuca]
call SetUnhandledExceptionFilter
;----------------------------------------------------------------------------
pop eax ;obnovi navratovu hodnotu
cmp eax, -1 ;testuje, ci sa mu to podarilo
jnz skok ;ak ano skoci, pretoze Soft-Ice je aktivny v pamati
continiue:
call MessageBoxA,0, offset sprava2, offset sprava1,0
call ExitProcess, -1
skok:
call MessageBoxA,0, offset sprava3, offset sprava1,0
call ExitProcess, -1
chyba: ;nova obsluha SEH pre pripad chyby
mov esp, [odlozESP]
push offset continiue
ret
ends
end Start